#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 1e5 + 5;
const int M = 1e9 + 7;
int t, m;
int a[3][N];

int pre[N], suf[N];

int main()
{
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> t;
    while (t--)
    {
        cin >> m;
        for (int i = 1; i <= 2; i++)
            for (int j = 1; j <= m; j++)
                cin >> a[i][j];

        pre[0] = 0;
        for (int i = 1; i <= m; i++)
            pre[i] = pre[i - 1] + a[2][i];

        suf[m + 1] = 0;
        for (int i = m; i >= 1; i--)
            suf[i] = suf[i + 1] + a[1][i];

        int res = 2e9;
        for (int i = 1; i <= m; i++)
            res = min(res, max(pre[i - 1], suf[i + 1]));

        cout << res << endl;
    }
    return 0;
}